# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=pkcrack
pkgver=1.2.2
pkgrel=2
groups=('blackarch' 'blackarch-cracker')
pkgdesc='A PkZip encryption cracker.'
arch=('x86_64' 'aarch64')
url='https://www.unix-ag.uni-kl.de/~conrad/krypto/pkcrack/download1.html'
license=('custom:unknown')
source=("https://www.unix-ag.uni-kl.de/~conrad/krypto/$pkgname/$pkgname-$pkgver.tar.gz")
sha512sums=('5c64fb9ae09dedc70fb20cd689f432059fcd64f689072b529b4045c3241760fee273ee921da081bc08be2e0594d27101c5d89d99cb2b84e16f80c011419b7200')

build() {
  cd "$pkgname-$pkgver/src"

  make
}

package() {
  cd "$pkgname-$pkgver"

  _tools="extract findkey makekey pkcrack zipdecrypt"

  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" doc/*

  cd src

  for i in $_tools ; do
    if [ "$i" != "pkcrack" ]
    then
      install -Dm 755 $i "$pkgdir/usr/bin/$pkgname-$i"
    else
      install -Dm 755 $i "$pkgdir/usr/bin/$pkgname"
    fi
  done
}

